#include "SGNodeTranslate.h"
#include "SGTree.h"

//constructor
SGNodeTranslate::SGNodeTranslate()
:m_translate(0, CVector3f())
{}

//destructor
//SGNodeTranslate::~SGNodeTranslate(){}


//update the node
void SGNodeTranslate::doUpdate()
{
	CMatrix t;
	t.createTranslation(m_translate);

	CMatrix p = SGTREE.getValue();

	SGTREE.setValue(t*p); //TRANSLATION * WORLD
}

//dirty the node
void SGNodeTranslate::dirty()
{
	m_translate.onChange();
}